package com.zhijiaoyun.dao;

import java.util.List;

import com.zhijiaoyun.dao.core.IBaseDao;
import org.apache.ibatis.annotations.Param;

import com.zhijiaoyun.model.BuyHistory;

/**
 * @author shisfish
 * @date 2017/6/6
 */
public interface IBuyHistoryDao extends IBaseDao<BuyHistory> {

	/**
	 * get by userId goodsId
	 * @param userId
	 * @param goodsId
	 * @param goodsType
	 * @return
	 */
	BuyHistory selectByUserIdGoodsId(@Param("userId") Long userId, @Param("goodsId") Long goodsId,
			@Param("goodsType") int goodsType);

	/**
	 * count
	 * @param userId
	 * @return
	 */
	int countByParams(Long userId);

	/**
	 * page
	 * @param beginIndex
	 * @param pageSize
	 * @param userId
	 * @return
	 */
	List<BuyHistory> pageByParams(@Param("beginIndex") int beginIndex, @Param("pageSize") int pageSize,
			@Param("userId") Long userId);

	/**
	 * list by goodsId
	 * @param beginIndex
	 * @param pageSize
	 * @param goodsId
	 * @param goodsType
	 * @return
	 */
	List<BuyHistory> selectByGoodsId(@Param("beginIndex") int beginIndex, @Param("pageSize") int pageSize,
			@Param("goodsId") Long goodsId, @Param("goodsType") int goodsType);
}